// pages/map/map.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    longitude:"",
    latitude:"",
    makers:[{
      latitude:"",
      longitude:"",
      title:"hello",
      iconPath:'../../images/maker.png',
      width:30,
      height:30




    }],

    polyline: [{
      points: [{
        longitude: 102.85526022885594,
        latitude: 24.859049446917332
      }, 
      // {
      //     longitude: 102.85515723204614,
      //     latitude: 24.859545918303425
      // },
        {
          longitude: 102.85506281825607,
          latitude: 24.859667602162574
        },
        {
          longitude: 102.85535464260508,
          latitude: 24.85975424093788
        },
        {
          longitude: 102.85726866668799,
          latitude: 24.860019997839217
        },
        {
          longitude: 102.85780510861375,
          latitude: 24.86054372211661
        }
        ,{
          longitude: 102.85792527138116,
          latitude: 24.861191073573412
        },
        {
          longitude: 102.85763344699123,
          latitude: 24.86267169514425
        }
       

      
      ],
      color: "#33c9FFDD",
      width: 5,
      dottedLine: false
    }]

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    //获取经纬度

  wx.getLocation({
    success: (result) => {
      console.log(result);
      var that=this;
      that.setData({
        longitude: 102.85526022885594,
        latitude: 24.859049446917332,
        'makers.latitude': 24.859049446917332,
        'makers.longitude': 102.85526022885594,
      })
    },
    fail: () => {},
    complete: () => {}
  });
    

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})